import {createRouter, createWebHashHistory} from 'vue-router'

const routes = [
  {
    path:'/',
    name:'home',
    component:()=>import('../views/Home')
  },
  {
    path:'/login',
    name:'login',
    component:()=>import('../views/Login')
  },
  {
    path:'/receipt/:oid',
    name:'receiptInfo',
    component:()=>import('../views/user_service/Receipt')
  },
  {
    path: '/dispatch_server',
    name:"dispatch_server",
    component: ()=>import('../views/dispatch_service/Index'),
    children:[
      {
        path: '/orderInquire',
        name: 'orderInquire',
        component : () => import('../views/dispatch_service/OrderInquire')
      },
      {
        path: '/createTask',
        name: 'createTask',
        component : () => import('../views/dispatch_service/createTask')
      },
    ]
  },
  {
    path: '/GetImg',
    name: 'getImg',
    component: () => import('../views/distribution_service/GetImg')
  },
  {
    path: '/Receipt',
    name: 'receipt',
    component : () => import('../views/distribution_service/Receipt')
  },
  {
    path: '/Receipt',
    name: 'receipt',
    component : () => import('../views/distribution_service/Receipt')
  },
  {
    path: '/Index',
    name: 'index',
    component: () => import('../views/distribution_service/DistributionServiceIndex'),
    children : [
      {

        path: '/FindTaskList',
        name: 'findtasklist',
        component : () => import('../views/distribution_service/FindTaskList')
      },
      {
        path: '/DistributeTaskList',
        name: 'distributetasklist',
        component : () => import('../views/distribution_service/DistributeTaskList')
      },
      {
        path: '/PrintTaskList',
        name: 'printTaskList',
        component : () => import('../views/distribution_service/PrintTaskList')
      },
      {
        path: '/Main',
        name: 'main',
        component : () => import('../components/Main')
      },
      {
        path: '/ReceiptEntry',
        name: 'receiptEntry',
        component : () => import('../views/distribution_service/ReceiptEntry')

      }

    ]
  },
  {
    path: '/user_server',
    name:"user_server",
    component: ()=>import('../views/user_service/Index'),
    children:[

      // {
      //   path: '/statistics',
      //   name: 'statistics',
      //   component : () => import('../views/user_service/Statistics')
      // },
      {
        path: '/userManage',
        name: 'userManage',
        component : () => import('../views/user_service/UserManage')
      },
      {
        path: '/orderManage',
        name: 'orderManage',
        component : () => import('../views/user_service/OrderManage')
      },

    ]
  },
  {
    path: '/operation',
    name:"operation-server",
    component: ()=>import('../views/operation_server/Index'),
    children:[
      {
        path: '/goodsManage',
        name: 'goodsManage',
        component : () => import('../views/operation_server/GoodsManage')
      },
      {
        path: '/vendorManage',
        name: 'vendorManage',
        component : () => import('../views/operation_server/VendorManage')
      },
      {
        path: '/warehouseManage',
        name: 'warehouseManage',
        component : () => import('../views/operation_server/WarehouseManage')
      },
      {
        path: '/supplyManage',
        name: 'supplyManage',
        component : () => import('../views/operation_server/SupplyManage')
      },

    ]
  },
  {
    path: '/user',
    name:"user",
    component: ()=>import('../views/user/Index'),
    children:[

      {
        path: '/shopping',
        name: 'shopping',
        component : () => import('../views/user/Shopping')
      },
      {
        path: '/myorder',
        name: 'myorder',
        component : () => import('../views/user/MyOrder')
      },
      {
        path: '/userinfo',
        name: 'userinfo',
        component : () => import('../views/user/UserInfo')
      },

    ]
  },
  {
    path: '/warehouse',
    name:"warehouse",
    component: ()=>import('../views/warehouse_service/WarehouseIndex'),
    children: [
      {
        path: '/entryOrderList',
        name: "entryOrderList",
        component: ()=>import('../views/warehouse_service/EntryOrder')
      },
      {
        path: '/inventoryList',
        name: "inventoryList",
        component: ()=>import('../views/warehouse_service/InventoryList')
      },
      {
        path: '/distributionOrderList',
        name: "distributionOrderList",
        component: ()=>import('../views/warehouse_service/DistributionOrder')
      },
      {
        path: '/outOrderList',
        name: "outOrderList",
        component: ()=>import('../views/warehouse_service/OutOrder')
      }
    ]
  },
  {
    path: '/financial',
    name:"financial-server",
    component: ()=>import('../views/financial_server/Index'),
    children:[
      {
        path: '/purchaseOrderManage',
        name: 'purchaseOrderManage',
        component : () => import('../views/financial_server/PurchaseOrderManage')
      },
      {
        path: '/payableOrderManage',
        name: 'payableOrderManage',
        component : () => import('../views/financial_server/PayableOrderManage')
      },
      {
        path: '/financialVoucherManage',
        name: 'financialVoucherManage',
        component : () => import('../views/financial_server/FinancialVoucherManage')
      },
      {
        path: '/invoiceManage',
        name: 'invoiceManage',
        component : () => import('../views/financial_server/InvoiceManage')
      },

    ]
  },

]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
